<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/common/topBegin.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/Validform.css"/>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/right_yz.css"/>
 <script type="text/javascript" src="${ctx}/js/jquery-1.7.1.min.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/Validform_v5.3.2.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/right_Validform_v5.3.2_config.js"></script>
 <script type="text/javascript" src="${ctx}/js/ajaxfileupload.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ext-base.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ext-all.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ui/ext-ui.js"></script>
<script type="text/javascript" src="${ctx}/js/public/console.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ux/Toast.js"></script>
<script>
var cfg = {cxt:'${ctx}'};
<c:if test="${not empty entity.id}">
	<c:set var="url" value="site/update.action"/>
</c:if>
<c:if test="${ empty entity||empty entity.id}">
<c:set var="url" value="site/add.action"/>
</c:if>
</script>
</head>
<body>
<div  id="table_form_div" class="table_form1">
<form  action="${ctx}/${url}" method="post" id="formobj" enctype="multipart/form-data">
 <input type="hidden" id="subBtn"   />
 <input type="hidden" id="backTip"  value="操作成功" />
  <table class="table-form" width="100%">
   <tbody>
      <tr>
	       <td width="15%" class="table-th">站点名称<font color="red">*</font></td>
	       <td class="table-td" width="38%">
	           <input type="text" id="name"  class="input-text" style="width:90%;" name="name" value="${entity.name}" maxlength="16"   datatype="*" />
	       </td>
	       <td rowspan="7" colspan="2" align="center">
    		<img src="<c:if test='${not empty entity.contractPhoto}'>${ctx}/upload/${entity.contractPhoto}</c:if>
	         <c:if test='${empty entity.contractPhoto}'>${ctx}/images/organ/nophoto.gif </c:if>" id="img_photo" style="width: 90%;height:350px;"><br>
	         <input type="file"  id="photoFile" name="file" style="display:none" />
	         <input type="hidden" name="contractPhoto" id="hid_photo"  value="${entity.contractPhoto }" />
	         <div id="photo_div"/>
    	  </td>
	  </tr>
	  <tr>
	      <td width="15%" class="table-th">所在单位<font color="red">*</font></td>
	      <td class="table-td" width="38%">
	      	<c:choose>
	      		<c:when test="${empty entity.type|| entity.type==1 }">
	      			<input type="hidden" id="companyId" name="company.id" value="${entity.company.id }" />
	           		<input type="hidden" id="copmanyName"   value="${entity.company.name }" />
	       			<span id="sp_company"/>
	       		</c:when>
	       		<c:otherwise>
	       				${entity.company.name }
	       				<input type="hidden" id="companyId" name="company.id" value="${entity.company.id }" />
	       		</c:otherwise>
	       	</c:choose>
	      </td>  
	  </tr>
	  <tr>
	  	 <td  width="15%" class="table-th">联系人<font color="red">*</font></td>
	  	 <td class="table-td"  width="38%">
           		<input type="text" id="contractor"  class="input-text" name="contractor"  style="width:90%;" value="${entity.contractor}" maxlength="16" datatype="*"/>
         </td>
	  </tr>
	  　
      <tr>
      	  <td  width="15%" class="table-th">联系人身份证</td>
	      <td class="table-td"  width="38%"> 
	       	<input type="text" id="contractIdno"  class="input-text" style="width:90%;" name="contractIdno" value="${entity.contractIdno}" maxlength="18"   datatype="idcard" ignore="ignore"  />
	      </td>
	  </tr>
	   <tr>
   			<td width="15%" class="table-th">联系电话<font color="red">*</font></td>
            <td class="table-td"  width="38%">
           		<input type="text" id="contractPhone"  class="input-text" name="contractPhone"  style="width:90%;" value="${entity.contractPhone}" maxlength="16" datatype="m|phone"/>
            </td>
      </tr>
      <tr>
           <td width="15%" class="table-th">家庭电话</td>
           <td class="table-td"  width="38%">
               <input type="text" id="contractHomePhone"  class="input-text" style="width:90%;" name="contractHomePhone" value="${entity.contractHomePhone}" maxlength="16" datatype="m|phone" ignore="ignore"  />
           </td>
      </tr>
  	<tr>
	      <td width="15%" class="table-th">所在区域<font color="red">*</font></td>
	      	 <td class="table-td"  width="38%">
      	 		<span style="margin:0px 5px;">
      	 			<select id="province" name="provinceId" style="width:100px;" datatype="*"></select>
      	 			<input type="hidden" id="provinceName" name="provinceName" value="${entity.provinceName }"/>
      	 		</span>
	      	  	<span style="margin:5px 5px;">
	      	  		<select id="city" name="cityId"  style="width:100px;display:none" datatype="*"></select>
	      	  		<input type="hidden" id="cityName"  name="cityName" value="${entity.cityName }"/>
	      	  	</span>
	     		<span style="margin:5px 5px;">
	     			<select id="area" name="areaId"  style="width:120px;display:none" datatype="*"></select>
	     			<input type="hidden" id="areaName" " name="areaName" value="${entity.areaName }"/>
	     		</span>
		     </td>
      </tr>       
      <tr>
       <td   width="15%" class="table-th" >地址<font color="red">*</font></td>
	       <td    class="table-td"  colspan="2"> 
			    <textArea id="address"  class="textarea" style="width:98%;" cols="80" rows="2" name="address"  maxlength="100"   datatype="*" >${entity.address }</textArea>
	       </td>
	    </tr>
     <tr>
      <td width="15%" class="table-th">备注</td>
	       <td class="table-td" colspan="2">
	           <textArea id="remark"  class="textarea" style="width:98%;" cols="85" rows="3" name="remark"  maxlength="500" >${entity.remark }</textArea>
	       </td>
     </tr>
	 </tbody>
  </table>
   <input type="hidden" id="id"  name="id" value="${entity.id}" />
   <input type="hidden" id="type"  name="type" value="<c:choose><c:when test="${empty entity.type ||type==1}">1</c:when><c:otherwise>2</c:otherwise></c:choose>"/>
  </form>
  </div>
  <script type="text/javascript" src="${ctx}/js/public/area-jquery.js"></script>
  <script>
	$.areaInitByJson('${ctx}/area/areaList.action');
	$("#province").areaSelectedText("${entity.provinceId}");
	$('#city').areaCascadeByJson('province','${ctx}/area/areaList.action','${entity.cityId}');
	$("#area").areaCascadeByJson('city','${ctx}/area/areaList.action','${entity.areaId}');
  </script>
  <script type="text/javascript" src="${ctx}/js/app-web/biz/site/siteForm.js"></script>
  </body>
  </html>
  